<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Error handling</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_error_handling.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Error handling<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>OCILIB provides two mechanisms for error handling:</p>
<ul>
<li>Global error handling through callbacks.</li>
<li>Contextual thread error handling</li>
</ul>
<p>Exceptions are raised:</p>
<ul>
<li>On Oracle OCI API call error</li>
<li>On Oracle SQL statement error</li>
<li>On Internal OCILIB error (type checking, memory allocations ...)</li>
<li>On Oracle warnings (OCI API or SQL)</li>
</ul>
<p>If an error handler was provided to <a class="el" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1" title="Initialize the library. ">OCI_Initialize()</a>, when an error occurs, the library generates an OCI_Error handle and pass it to the error handler.</p>
<p>In order to use the thread contextual error handling, you must call <a class="el" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1" title="Initialize the library. ">OCI_Initialize()</a> with the flag OCI_ENV_CONTEXT for the mode parameter. When activated, error handles are stored per thread and the last error within a thread can be retrieved with <a class="el" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c" title="Retrieve the last error or warning occurred within the last OCILIB call. ">OCI_GetLastError()</a></p>
<p>Exception properties are accessible through a set of functions</p>
<dl class="section note"><dt>Note</dt><dd>The two ways to handle errors are not exclusive and can be mixed.</dd>
<dd>
Thread contextual error is also available for single thread based applications</dd></dl>
<dl class="section user"><dt>Oracle Warnings</dt><dd></dd></dl>
<p>Oracle warnings are raised through OCI_Error API. Such error handles have their error type property (<a class="el" href="group___ocilib_c_api_error_handling.html#ga66d447c8cd06ea3f841b439a1aac055b" title="Retrieve the type of error from error handle. ">OCI_ErrorGetType()</a>) set to OCI_ERR_WARNING. Warning handing is disabled by default. To activate/deactivate it, use <a class="el" href="group___ocilib_c_api_initialization.html#ga60f3ade91299999200076cd53ed9066e" title="Enable or disable Oracle warning notifications. ">OCI_EnableWarnings()</a></p>
<dl class="section user"><dt>Example with callbacks</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> err_handler(<a class="code" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</div>
<div class="line">{</div>
<div class="line">    printf(</div>
<div class="line">                <span class="stringliteral">&quot;code  : ORA-%05i\n&quot;</span></div>
<div class="line">                <span class="stringliteral">&quot;msg   : %s\n&quot;</span></div>
<div class="line">                <span class="stringliteral">&quot;sql   : %s\n&quot;</span>,</div>
<div class="line">                <a class="code" href="group___ocilib_c_api_error_handling.html#ga76fb68323de3574fb92a8027e8c4280e">OCI_ErrorGetOCICode</a>(err), </div>
<div class="line">                <a class="code" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a>(err),</div>
<div class="line">                <a class="code" href="group___ocilib_c_api_statements.html#gabb4eca3a2c07a9f031c3f2f257663da8">OCI_GetSql</a>(<a class="code" href="group___ocilib_c_api_error_handling.html#gab099d59cd4faf2fa6a4430114ea73402">OCI_ErrorGetStatement</a>(err))</div>
<div class="line">           );</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(err_handler, NULL, OCI_ENV_DEFAULT))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(<span class="stringliteral">&quot;wrong_db&quot;</span>, <span class="stringliteral">&quot;wrong_usr&quot;</span>, <span class="stringliteral">&quot;wrong_pwd&quot;</span>, </div>
<div class="line">                              OCI_SESSION_DEFAULT);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* ... application code here ... */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --></dd></dl>
<dl class="section user"><dt>Example with thread context</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT | OCI_ENV_CONTEXT))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(<span class="stringliteral">&quot;wrong_db&quot;</span>, <span class="stringliteral">&quot;wrong_usr&quot;</span>, <span class="stringliteral">&quot;wrong_pwd&quot;</span>, </div>
<div class="line">                              OCI_SESSION_DEFAULT);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (cn == NULL)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err = <a class="code" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c">OCI_GetLastError</a>();</div>
<div class="line"></div>
<div class="line">        printf(<span class="stringliteral">&quot;errcode %d, errmsg %s&quot;</span>, <a class="code" href="group___ocilib_c_api_error_handling.html#ga76fb68323de3574fb92a8027e8c4280e">OCI_ErrorGetOCICode</a>(err), </div>
<div class="line">                                        <a class="code" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a>(err));</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --></dd></dl>
<dl class="section user"><dt>Example of warning handling</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> err_handler(<a class="code" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span>   err_type = <a class="code" href="group___ocilib_c_api_error_handling.html#ga66d447c8cd06ea3f841b439a1aac055b">OCI_ErrorGetType</a>(err);</div>
<div class="line">    <span class="keywordtype">char</span> *err_msg  = <a class="code" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a>(err);</div>
<div class="line"></div>
<div class="line">    printf(<span class="stringliteral">&quot;%s - %s\n&quot;</span>, err_type == OCI_ERR_WARNING ? <span class="stringliteral">&quot;warning&quot;</span> : <span class="stringliteral">&quot;error&quot;</span>, err_msg);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(err_handler, NULL, OCI_ENV_DEFAULT))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga60f3ade91299999200076cd53ed9066e">OCI_EnableWarnings</a>(TRUE);</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(<span class="stringliteral">&quot;db&quot;</span>, <span class="stringliteral">&quot;usr&quot;</span>, <span class="stringliteral">&quot;expired_pwd_in_grace_period&quot;</span>, </div>
<div class="line">                              OCI_SESSION_DEFAULT);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* ... application code here ... */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
<div class="line"></div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf2abe52ad5b278f65dd97a44a2adac4c"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c">OCI_GetLastError</a> (void)</td></tr>
<tr class="memdesc:gaf2abe52ad5b278f65dd97a44a2adac4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the last error or warning occurred within the last OCILIB call.  <a href="#gaf2abe52ad5b278f65dd97a44a2adac4c">More...</a><br /></td></tr>
<tr class="separator:gaf2abe52ad5b278f65dd97a44a2adac4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga661d5229057b291ef25bb344315f7c38"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT const otext *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:ga661d5229057b291ef25bb344315f7c38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve error message from error handle.  <a href="#ga661d5229057b291ef25bb344315f7c38">More...</a><br /></td></tr>
<tr class="separator:ga661d5229057b291ef25bb344315f7c38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga66d447c8cd06ea3f841b439a1aac055b"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#ga66d447c8cd06ea3f841b439a1aac055b">OCI_ErrorGetType</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:ga66d447c8cd06ea3f841b439a1aac055b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the type of error from error handle.  <a href="#ga66d447c8cd06ea3f841b439a1aac055b">More...</a><br /></td></tr>
<tr class="separator:ga66d447c8cd06ea3f841b439a1aac055b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76fb68323de3574fb92a8027e8c4280e"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#ga76fb68323de3574fb92a8027e8c4280e">OCI_ErrorGetOCICode</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:ga76fb68323de3574fb92a8027e8c4280e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve Oracle Error code from error handle.  <a href="#ga76fb68323de3574fb92a8027e8c4280e">More...</a><br /></td></tr>
<tr class="separator:ga76fb68323de3574fb92a8027e8c4280e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa59683a2cd8d8a5eb7d652fb153ff6c1"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#gaa59683a2cd8d8a5eb7d652fb153ff6c1">OCI_ErrorGetInternalCode</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:gaa59683a2cd8d8a5eb7d652fb153ff6c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve Internal Error code from error handle.  <a href="#gaa59683a2cd8d8a5eb7d652fb153ff6c1">More...</a><br /></td></tr>
<tr class="separator:gaa59683a2cd8d8a5eb7d652fb153ff6c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1dcd57ceeb422c050dd3791ff0372e1"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#gaa1dcd57ceeb422c050dd3791ff0372e1">OCI_ErrorGetConnection</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:gaa1dcd57ceeb422c050dd3791ff0372e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve connection handle within the error occurred.  <a href="#gaa1dcd57ceeb422c050dd3791ff0372e1">More...</a><br /></td></tr>
<tr class="separator:gaa1dcd57ceeb422c050dd3791ff0372e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab099d59cd4faf2fa6a4430114ea73402"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#gab099d59cd4faf2fa6a4430114ea73402">OCI_ErrorGetStatement</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:gab099d59cd4faf2fa6a4430114ea73402"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve statement handle within the error occurred.  <a href="#gab099d59cd4faf2fa6a4430114ea73402">More...</a><br /></td></tr>
<tr class="separator:gab099d59cd4faf2fa6a4430114ea73402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9bbafe173059e065d3bc8d805c0d7033"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_error_handling.html#ga9bbafe173059e065d3bc8d805c0d7033">OCI_ErrorGetRow</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</td></tr>
<tr class="memdesc:ga9bbafe173059e065d3bc8d805c0d7033"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the row index which caused an error during statement execution.  <a href="#ga9bbafe173059e065d3bc8d805c0d7033">More...</a><br /></td></tr>
<tr class="separator:ga9bbafe173059e065d3bc8d805c0d7033"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaf2abe52ad5b278f65dd97a44a2adac4c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a>* OCI_API OCI_GetLastError </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve the last error or warning occurred within the last OCILIB call. </p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c" title="Retrieve the last error or warning occurred within the last OCILIB call. ">OCI_GetLastError()</a> is based on thread context and thus OCILIB must be initialized with the flag OCI_ENV_CONTEXT</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>OCILIB functions that returns a boolean value to indicate their success :<ul>
<li>return TRUE if no error occurred OR if a warning occurred</li>
<li>return FALSE if an error occurred </li>
</ul>
</dd></dl>

<p>Referenced by <a class="el" href="namespaceocilib.html#aa58f566c50829a5d44c812970060afd7">ocilib::Check()</a>.</p>

</div>
</div>
<a class="anchor" id="ga661d5229057b291ef25bb344315f7c38"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT const otext* OCI_API OCI_ErrorGetString </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve error message from error handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga66d447c8cd06ea3f841b439a1aac055b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve the type of error from error handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Returns one of the following values:</dd></dl>
<ul>
<li>OCI_ERR_ORACLE</li>
<li>OCI_ERR_OCILIB</li>
<li>OCI_ERR_WARNING</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>Object type or OCI_UNKNOWN the input handle is NULL </dd></dl>

</div>
</div>
<a class="anchor" id="ga76fb68323de3574fb92a8027e8c4280e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT int OCI_API OCI_ErrorGetOCICode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve Oracle Error code from error handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa59683a2cd8d8a5eb7d652fb153ff6c1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve Internal Error code from error handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa1dcd57ceeb422c050dd3791ff0372e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a>* OCI_API OCI_ErrorGetConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve connection handle within the error occurred. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gab099d59cd4faf2fa6a4430114ea73402"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a>* OCI_API OCI_ErrorGetStatement </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Retrieve statement handle within the error occurred. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If the error occurred outside of a statement context, it returns NULL </dd></dl>

</div>
</div>
<a class="anchor" id="ga9bbafe173059e065d3bc8d805c0d7033"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *&#160;</td>
          <td class="paramname"><em>err</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the row index which caused an error during statement execution. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err</td><td>- Error handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Row index start at 1.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>0 is the error is not related to array DML otherwise the index of the given row which caused the error </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:36 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
